package com.zxcz.controller;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.zxcz.domain.Devices;
import com.zxcz.domain.PageResult;
import com.zxcz.domain.Result;
import com.zxcz.service.DevicesService;

@RestController
@RequestMapping(value = "/devices")
public class DevicesController {
	@Autowired
	private DevicesService devicesService;
	private static final Log logger = LogFactory.getLog(DevicesController.class);

	
	/**
	 * 分页
	 */
	@RequestMapping("/fingPage")
	public PageResult findPage(int pageNum,int pageSize, String deviceId, String mac, String account) {
		return devicesService.findPage(pageNum, pageSize, deviceId, mac, account);
	}
	
	@RequestMapping("/userDevice")
	public PageResult userDevicePage(int pageNum,int pageSize, String deviceId, String mac) {
		return devicesService.userDevicePage(pageNum, pageSize, deviceId, mac);
	}
	
	@RequestMapping("/unBundling")
	public Result<Object> unBundling(Devices device) {
		logger.info(device);
		return devicesService.unBundling(device);
	}
}
